<template>

  <div>{{ globalVariable }}</div>

  <button @click="fetchData">获取数据</button>

</template>

<script setup lang="ts">
import { ref, reactive, inject } from 'vue'
import request, { setBaseURL } from '@/utils/request'

// 注入全局变量
const globalVariable = inject('globalVariable');


const fetchData = () => {
  // setUel('http://192.168.1.100:8080')

  globalVariable.value = '重新估值'

  setBaseURL('http://127.0.0.1:19321')
  console.log('request = ', request.get('/api/test'))

}


// onMounted(fetchData)
</script>

<style scoped>
/* 可根据需要自定义样式 */
</style>
